package lab03.test01;

import java.io.BufferedWriter;
import java.io.FileWriter;
import java.io.IOException;

/**
 * Created by Administrator on 2017/11/16.
 */
public class Test {
    public static void main(String[] args) {


        String path ="D:\\hello.txt";//路径
        BufferedWriter writer = null;

        //1 字符流
        try{
            writer = new BufferedWriter(new FileWriter(path));

            writer.write("hello,world!");//
            writer.newLine();//换行

            writer.write("0101010101010");
            writer.newLine();

            writer.write("bye!!!!");

        } catch (IOException e) {
            e.printStackTrace();
        }finally {


            try {
                writer.close();
            } catch (IOException e) {
                e.printStackTrace();
            }
        }
    }
}

